const express = require("express");
const exApp = express();
const cors = require("cors");
const path = require("path");
exApp.use(express.json());
exApp.use(express.urlencoded({ extended: false })); // 表单请求
exApp.use(cors()); // 跨域

exApp.use("/c", require("./router/user/index")); // 使用后端路由
exApp.use("/store", require("./router/store/index"));
exApp.use("/vip", require("./router/vip/index"));
// 上传图片
exApp.use("/update", require("./router/update/upimage"));

// 开放静态图片端口
exApp.use(express.static(path.resolve("./public")));

exApp.listen(8888, () => console.log(`启动成功:http://localhost:8888/`));
